home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / RCS / Fs_IOControl.c,v < prev    next >
Encoding:
Text File  |  1991-12-08  |  2.9 KB  |  139 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.2.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     89.09.27.16.52.47;  author douglis;  state Exp;
  11. branches 1.2.1.1;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     89.09.27.16.52.05;  author douglis;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19. 1.2.1.1
  20. date     91.12.08.15.05.06;  author kupfer;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @ioctl stub to retry upon signals when appropriate
  27. @
  28.  
  29.  
  30. 1.2
  31. log
  32. @don't retry IOC_LOCK -- too dangerous
  33. @
  34. text
  35. @/* 
  36.  * Fs_IOControl.c --
  37.  *
  38.  *    Source code for the Fs_IOControl library procedure.
  39.  *
  40.  * Copyright 1988 Regents of the University of California
  41.  * Permission to use, copy, modify, and distribute this
  42.  * software and its documentation for any purpose and without
  43.  * fee is hereby granted, provided that the above copyright
  44.  * notice appear in all copies.  The University of California
  45.  * makes no representations about the suitability of this
  46.  * software for any purpose.  It is provided "as is" without
  47.  * express or implied warranty.
  48.  */
  49.  
  50. #ifndef lint
  51. static char rcsid[] = "$Header: Fs_IOControl.c,v 1.2 88/06/21 11:14:55 ouster Exp $ SPRITE (Berkeley)";
  52. #endif not lint
  53.  
  54. #include <sprite.h>
  55. #include <status.h>
  56. #include <fs.h>
  57.  
  58.  
  59. /*
  60.  *----------------------------------------------------------------------
  61.  *
  62.  * Fs_IOControl --
  63.  *
  64.  *      The "normal" Fs_IOControl interface for user code.
  65.  *    Retries some operations when GEN_ABORTED_BY_SIGNAL is
  66.  *    returned from the kernel.  The list of operations is not
  67.  *    yet inclusive.  
  68.  *
  69.  * Results:
  70.  *    An error code.
  71.  *
  72.  * Side effects:
  73.  *    Variable.
  74.  *
  75.  *----------------------------------------------------------------------
  76.  */
  77.  
  78. ReturnStatus
  79. Fs_IOControl(streamID, command, inBufSize, inBuffer, outBufSize, outBuffer)
  80.     int     streamID;    /* User's handle on the stream */
  81.     int     command;    /* IOControl command */
  82.     int     inBufSize;    /* Size of inBuffer */
  83.     Address     inBuffer;    /* Command specific input parameters */
  84.     int     outBufSize;    /* Size of outBuffer */
  85.     Address     outBuffer;    /* Command specific output parameters */
  86. {
  87.     ReturnStatus status;
  88.     do {
  89.     status = Fs_RawIOControl(streamID, command, inBufSize, inBuffer,
  90.                  outBufSize, outBuffer);
  91.     if (status == GEN_ABORTED_BY_SIGNAL) {
  92.         switch(command) {
  93. #ifdef notdef
  94. /*
  95.  * IOC_LOCK can block forever unexpectedly if a signal is suppressed.
  96.  */
  97.         case IOC_LOCK:
  98. #endif
  99.         case IOC_UNLOCK:
  100.         case IOC_NUM_READABLE:
  101.         case IOC_TRUNCATE:
  102.         case IOC_GET_OWNER:
  103.         case IOC_SET_OWNER:
  104.         case IOC_MAP:
  105.         case IOC_REPOSITION:
  106.         case IOC_SET_FLAGS: 
  107.         case IOC_CLEAR_BITS:
  108.         break;
  109.  
  110.         default:
  111.         return(status);
  112.         }
  113.     }
  114.     } while (status == GEN_ABORTED_BY_SIGNAL);
  115.     return(status);
  116. }
  117. @
  118.  
  119.  
  120. 1.2.1.1
  121. log
  122. @Initial branch for Sprite server.
  123. @
  124. text
  125. @d17 1
  126. a17 1
  127. static char rcsid[] = "$Header: /sprite/src/lib/c/syscall/RCS/Fs_IOControl.c,v 1.2 89/09/27 16:52:47 douglis Exp $ SPRITE (Berkeley)";
  128. @
  129.  
  130.  
  131. 1.1
  132. log
  133. @Initial revision
  134. @
  135. text
  136. @d59 4
  137. d64 1
  138. @
  139.